﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web
{
    public partial class Default : System.Web.UI.Page
    {
        public List<study.Model.tb_flasad> adlist;
        public study.Model.tb_site_info sitmod = new study.Model.tb_site_info();

        study.BLL.tb_site_info sitbll = new study.BLL.tb_site_info();
        study.BLL.tb_flasad fadbll = new study.BLL.tb_flasad();
       // study.BLL.tb_bbs_note nobll = new study.BLL.tb_bbs_note();
        study.BLL.vi_note_list vibll = new study.BLL.vi_note_list();
        study.BLL.tb_user userbll = new study.BLL.tb_user();
        study.BLL.tb_file filebll = new study.BLL.tb_file();
        study.BLL.tb_topic topbll = new study.BLL.tb_topic();
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["MENU_SELECTED"] = 0;
            
            this.login.Visible = false;
            login_status.Visible = false;
            if (Session["USER"] != null)
            {
                this.login_status.Visible = true;
                //login_status.uermod = ((study.Model.tb_user)Session["USER"]).ID;
                //login_status.DataBind();
                login_status.loadover(true);
            }

            this.login.Visible = !this.login_status.Visible;
            
            StringBuilder strWhere = new StringBuilder();
            strWhere.AppendFormat("is_show like '%{0}%'", 1);
            adlist = fadbll.GetModelList(strWhere.ToString());
            if (!IsPostBack)
            {
                databond();
            }
        }
        protected void databond()
        {

            sitmod =  sitbll.GetModel(1);
            
            hotnote.DataSource = vibll.GetList(5, "", "ID");
            hotnote.DataBind();
            hotuser.DataSource = userbll.GetList(5, "", "count");
            hotuser.DataBind();
            ress.DataSource = filebll.GetList(5, "", "downtiem");
            ress.DataBind();
            topic.DataSource= topbll.GetList(5, "", "ID");
            topic.DataBind();
        }
    }
}